using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_BRANCH.
    /// </summary>
    public class DM_BRANCH
    {
              private string _ID;
      private Int32 _IDPOS;
      private string _Branch_Name;
      private string _Branch_Address;
      private string _Branch_Phone;
      private string _Branch_Fax;
      private string _Branch_Email;
      private string _Branch_Note;
      private byte[] _Branch_Logo;
      private byte[] _Branch_Image;
      private string _Branch_Director;
      private decimal _Branch_Revenue;
      private string _Branch_Facebook;
      private DateTime _DateTimeBeginLicence;
      private DateTime _DateTimeEndLicence;
      private bool _HasLicenceKey;
      private string _Version;
      private bool _IsUse;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public string ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public Int32 IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
    public bool IsSetBranch_Name; 
    public bool IsBranch_NameNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Name
    {
        get{ return _Branch_Name;  }
        set
		{
			_Branch_Name = value;
			IsSetBranch_Name = true;
		}
    }
    public bool IsSetBranch_Address; 
    public bool IsBranch_AddressNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Address
    {
        get{ return _Branch_Address;  }
        set
		{
			_Branch_Address = value;
			IsSetBranch_Address = true;
		}
    }
    public bool IsSetBranch_Phone; 
    public bool IsBranch_PhoneNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Phone
    {
        get{ return _Branch_Phone;  }
        set
		{
			_Branch_Phone = value;
			IsSetBranch_Phone = true;
		}
    }
    public bool IsSetBranch_Fax; 
    public bool IsBranch_FaxNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Fax
    {
        get{ return _Branch_Fax;  }
        set
		{
			_Branch_Fax = value;
			IsSetBranch_Fax = true;
		}
    }
    public bool IsSetBranch_Email; 
    public bool IsBranch_EmailNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Email
    {
        get{ return _Branch_Email;  }
        set
		{
			_Branch_Email = value;
			IsSetBranch_Email = true;
		}
    }
    public bool IsSetBranch_Note; 
    public bool IsBranch_NoteNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Note
    {
        get{ return _Branch_Note;  }
        set
		{
			_Branch_Note = value;
			IsSetBranch_Note = true;
		}
    }
    public bool IsSetBranch_Logo; 
    public bool IsBranch_LogoNullable   
    { 
		get { return false;  } 
    }
    public byte[] Branch_Logo
    {
        get{ return _Branch_Logo;  }
        set
		{
			_Branch_Logo = value;
			IsSetBranch_Logo = true;
		}
    }
    public bool IsSetBranch_Image; 
    public bool IsBranch_ImageNullable   
    { 
		get { return false;  } 
    }
    public byte[] Branch_Image
    {
        get{ return _Branch_Image;  }
        set
		{
			_Branch_Image = value;
			IsSetBranch_Image = true;
		}
    }
    public bool IsSetBranch_Director; 
    public bool IsBranch_DirectorNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Director
    {
        get{ return _Branch_Director;  }
        set
		{
			_Branch_Director = value;
			IsSetBranch_Director = true;
		}
    }
    public bool IsSetBranch_Revenue; 
    public bool IsBranch_RevenueNullable   
    { 
		get { return false;  } 
    }
    public decimal Branch_Revenue
    {
        get{ return _Branch_Revenue;  }
        set
		{
			_Branch_Revenue = value;
			IsSetBranch_Revenue = true;
		}
    }
    public bool IsSetBranch_Facebook; 
    public bool IsBranch_FacebookNullable   
    { 
		get { return false;  } 
    }
    public string Branch_Facebook
    {
        get{ return _Branch_Facebook;  }
        set
		{
			_Branch_Facebook = value;
			IsSetBranch_Facebook = true;
		}
    }
    public bool IsSetDateTimeBeginLicence; 
    public bool IsDateTimeBeginLicenceNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateTimeBeginLicence
    {
        get{ return _DateTimeBeginLicence;  }
        set
		{
			_DateTimeBeginLicence = value;
			IsSetDateTimeBeginLicence = true;
		}
    }
    public bool IsSetDateTimeEndLicence; 
    public bool IsDateTimeEndLicenceNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateTimeEndLicence
    {
        get{ return _DateTimeEndLicence;  }
        set
		{
			_DateTimeEndLicence = value;
			IsSetDateTimeEndLicence = true;
		}
    }
    public bool IsSetHasLicenceKey; 
    public bool IsHasLicenceKeyNullable   
    { 
		get { return false;  } 
    }
    public bool HasLicenceKey
    {
        get{ return _HasLicenceKey;  }
        set
		{
			_HasLicenceKey = value;
			IsSetHasLicenceKey = true;
		}
    }
    public bool IsSetVersion; 
    public bool IsVersionNullable   
    { 
		get { return false;  } 
    }
    public string Version
    {
        get{ return _Version;  }
        set
		{
			_Version = value;
			IsSetVersion = true;
		}
    }
    public bool IsSetIsUse; 
    public bool IsIsUseNullable   
    { 
		get { return false;  } 
    }
    public bool IsUse
    {
        get{ return _IsUse;  }
        set
		{
			_IsUse = value;
			IsSetIsUse = true;
		}
    }

        #endregion

        #region Constructors
        public DM_BRANCH()
        {
            Reset();
        }
        public DM_BRANCH(DM_BRANCH obj)
        {
            	this._ID = obj.ID;
	this._IDPOS = obj.IDPOS;
	this._Branch_Name = obj.Branch_Name;
	this._Branch_Address = obj.Branch_Address;
	this._Branch_Phone = obj.Branch_Phone;
	this._Branch_Fax = obj.Branch_Fax;
	this._Branch_Email = obj.Branch_Email;
	this._Branch_Note = obj.Branch_Note;
	this._Branch_Logo = obj.Branch_Logo;
	this._Branch_Image = obj.Branch_Image;
	this._Branch_Director = obj.Branch_Director;
	this._Branch_Revenue = obj.Branch_Revenue;
	this._Branch_Facebook = obj.Branch_Facebook;
	this._DateTimeBeginLicence = obj.DateTimeBeginLicence;
	this._DateTimeEndLicence = obj.DateTimeEndLicence;
	this._HasLicenceKey = obj.HasLicenceKey;
	this._Version = obj.Version;
	this._IsUse = obj.IsUse;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_string;
         _IDPOS = EmptyValues.v_Int32;
         _Branch_Name = EmptyValues.v_string;
         _Branch_Address = EmptyValues.v_string;
         _Branch_Phone = EmptyValues.v_string;
         _Branch_Fax = EmptyValues.v_string;
         _Branch_Email = EmptyValues.v_string;
         _Branch_Note = EmptyValues.v_string;
         _Branch_Logo = EmptyValues.v_bytes;
         _Branch_Image = EmptyValues.v_bytes;
         _Branch_Director = EmptyValues.v_string;
         _Branch_Revenue = EmptyValues.v_decimal;
         _Branch_Facebook = EmptyValues.v_string;
         _DateTimeBeginLicence = EmptyValues.v_DateTime;
         _DateTimeEndLicence = EmptyValues.v_DateTime;
         _HasLicenceKey = EmptyValues.v_bool;
         _Version = EmptyValues.v_string;
         _IsUse = EmptyValues.v_bool;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (Int32)reader["IDPOS"];
		}
                if(!(reader["Branch_Name"] is DBNull))
		{
			obj.Branch_Name = (string)reader["Branch_Name"];
		}
                if(!(reader["Branch_Address"] is DBNull))
		{
			obj.Branch_Address = (string)reader["Branch_Address"];
		}
                if(!(reader["Branch_Phone"] is DBNull))
		{
			obj.Branch_Phone = (string)reader["Branch_Phone"];
		}
                if(!(reader["Branch_Fax"] is DBNull))
		{
			obj.Branch_Fax = (string)reader["Branch_Fax"];
		}
                if(!(reader["Branch_Email"] is DBNull))
		{
			obj.Branch_Email = (string)reader["Branch_Email"];
		}
                if(!(reader["Branch_Note"] is DBNull))
		{
			obj.Branch_Note = (string)reader["Branch_Note"];
		}
                if(!(reader["Branch_Logo"] is DBNull))
		{
			obj.Branch_Logo = (byte[])reader["Branch_Logo"];
		}
                if(!(reader["Branch_Image"] is DBNull))
		{
			obj.Branch_Image = (byte[])reader["Branch_Image"];
		}
                if(!(reader["Branch_Director"] is DBNull))
		{
			obj.Branch_Director = (string)reader["Branch_Director"];
		}
                if(!(reader["Branch_Revenue"] is DBNull))
		{
			obj.Branch_Revenue = (decimal)reader["Branch_Revenue"];
		}
                if(!(reader["Branch_Facebook"] is DBNull))
		{
			obj.Branch_Facebook = (string)reader["Branch_Facebook"];
		}
                if(!(reader["DateTimeBeginLicence"] is DBNull))
		{
			obj.DateTimeBeginLicence = (DateTime)reader["DateTimeBeginLicence"];
		}
                if(!(reader["DateTimeEndLicence"] is DBNull))
		{
			obj.DateTimeEndLicence = (DateTime)reader["DateTimeEndLicence"];
		}
                if(!(reader["HasLicenceKey"] is DBNull))
		{
			obj.HasLicenceKey = (bool)reader["HasLicenceKey"];
		}
                if(!(reader["Version"] is DBNull))
		{
			obj.Version = (string)reader["Version"];
		}
                if(!(reader["IsUse"] is DBNull))
		{
			obj.IsUse = (bool)reader["IsUse"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["IDPOS"];
//            _Branch_Name = (reader["Branch_Name"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Name"];
//            _Branch_Address = (reader["Branch_Address"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Address"];
//            _Branch_Phone = (reader["Branch_Phone"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Phone"];
//            _Branch_Fax = (reader["Branch_Fax"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Fax"];
//            _Branch_Email = (reader["Branch_Email"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Email"];
//            _Branch_Note = (reader["Branch_Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Note"];
//            _Branch_Logo = (reader["Branch_Logo"] is DBNull)?DalTools.EmptyValues.v_bytes:(byte[])reader["Branch_Logo"];
//            _Branch_Image = (reader["Branch_Image"] is DBNull)?DalTools.EmptyValues.v_bytes:(byte[])reader["Branch_Image"];
//            _Branch_Director = (reader["Branch_Director"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Director"];
//            _Branch_Revenue = (reader["Branch_Revenue"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["Branch_Revenue"];
//            _Branch_Facebook = (reader["Branch_Facebook"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Branch_Facebook"];
//            _DateTimeBeginLicence = (reader["DateTimeBeginLicence"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateTimeBeginLicence"];
//            _DateTimeEndLicence = (reader["DateTimeEndLicence"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateTimeEndLicence"];
//            _HasLicenceKey = (reader["HasLicenceKey"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["HasLicenceKey"];
//            _Version = (reader["Version"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Version"];
//            _IsUse = (reader["IsUse"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsUse"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string ID, Int32 IDPOS, string Branch_Name, string Branch_Address, string Branch_Phone, string Branch_Fax, string Branch_Email, string Branch_Note, byte[] Branch_Logo, byte[] Branch_Image, string Branch_Director, decimal Branch_Revenue, string Branch_Facebook, DateTime DateTimeBeginLicence, DateTime DateTimeEndLicence, bool HasLicenceKey, string Version, bool IsUse)
        {
                     this._ID = ID;
         this._IDPOS = IDPOS;
         this._Branch_Name = Branch_Name;
         this._Branch_Address = Branch_Address;
         this._Branch_Phone = Branch_Phone;
         this._Branch_Fax = Branch_Fax;
         this._Branch_Email = Branch_Email;
         this._Branch_Note = Branch_Note;
         this._Branch_Logo = Branch_Logo;
         this._Branch_Image = Branch_Image;
         this._Branch_Director = Branch_Director;
         this._Branch_Revenue = Branch_Revenue;
         this._Branch_Facebook = Branch_Facebook;
         this._DateTimeBeginLicence = DateTimeBeginLicence;
         this._DateTimeEndLicence = DateTimeEndLicence;
         this._HasLicenceKey = HasLicenceKey;
         this._Version = Version;
         this._IsUse = IsUse;
        }
    }
}